import request from "@/utils/request"
import store from '../store'

export default {
    getList(){
        return request({
            url:'http://39.106.83.184:9002/score',
            method:'get'
        })
    },
    getPersonalList(){
        return request({
            url:'http://39.106.83.184:9002/score/personalScore',
            method:'get'
        })
    },
    scoresByUser(){
        return request({
            url:'http://39.106.83.184:9002/score/findScoresByUserId?token='+store.getters.token,
            method:'get'
        })
    },
    personalScoresByUser(){
        return request({url:'http://39.106.83.184:9002/score/personalScoresByUser?token='+store.getters.token,
            method:'get'
        })
    },    
    allScore(){
        return request({url:'http://39.106.83.184:9002/score/allScore?token='+store.getters.token,
            method:'get'
        })
    },
    allPersonalScore(){
        return request({
            url:'http://39.106.83.184:9002/score/allPersonalScore?token='+store.getters.token,
            method:'get'
        })
    },
    add(pojo){
        pojo.token = store.getters.token
        return request({
            url: 'http://39.106.83.184:9002/score',
            data: pojo
        })    
    },
    addPerson(pojo){
        pojo.token = store.getters.token
        return request({
            url: 'http://39.106.83.184:9002/score/addPersonalScore',
            method: 'post',
            data: pojo
        })
    },
    teamdraw(){
        return request({
            url:'http://39.106.83.184:9002/score/teamdraw?token',
            method:'post'
        })
    },
    
    persondraw(){
        return request({
            url: 'http://39.106.83.184:9002/score/persondraw',
            method: 'get',
        })    
    },

    singledraw(){
        return request({
            url: 'http://39.106.83.184:9002/score/singledraw',
            method: 'get',
        })    
    },
    updateMemberFlag(id){
        return request({
            url: 'http://39.106.83.184:9002/score/updateMemberFlag?userId='+id+"&token="+store.getters.token,
            method: 'get',
        })    
    },
    savePersonal(pojo){
        return request({
            url:'http://39.106.83.184:9002/score/savePersonal?token',
            method:'post',
            data: pojo
        })       
    },
    personalList(){
        return request({
            url: 'http://39.106.83.184:9002/score/personalList',
            method: 'get',
        })    
    },
}